#ifndef LVGL_APP_H
#define LVGL_APP_H

#include "lvgl/lvgl.h"
#include "PasswordMag.h"
#include <stdarg.h>
#include "lv_txt.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "RTOS_APP.h"
#include "malloc.h"
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#define TEST1 0
 
#if ( LV_MEM_CUSTOM == 0)
#define lv_free free
#define lv_malloc malloc
#define lv_relloc realloc
#else
#define lv_free lv_myfree
#define lv_malloc lv_mymalloc
#endif

typedef struct PasswordMatrix_Args_Tydef
{
    lv_obj_t* Obj; //上一个界面的基础页地址
    QueueHandle_t* Data_QueueHandle; //队列头部，用于将文本框上的数据读出。
}PswdMatr_Args_t;

typedef struct TextArea_Date_Tydef 
{
    lv_obj_t* ta;
    char * User_Data;
    lv_obj_t* Pri_Page;

}TextArea_Date_t;

typedef struct Return_Btn_Date_Tydef 
{
 
    lv_obj_t* Prev_Page;
    void (*ReBtn_CB)(void *);
    void * User_Data;

}Return_Btn_Args_t;


typedef struct msg_Date_Tydef 
{
 
  //  uint8_t*Pwd_levl;
    void (*ReBtn_CB1)(void *);
    void (*ReBtn_CB2)(void *);
    void * User_Data1;
    void * User_Data2;
}msg_Args_t;


void LVGL_Show_Info(const char* fmt,...);
void My_LVGL_Print(const char* fmt,...);
void My_LVGL_Scanf(const char* fmt,...);
void Return_fmtText(char * text,const char* fmt , ...);
lv_obj_t * Base_Page_Create(void);
//lv_obj_t* Return_Btn_Create(lv_obj_t* Current_BasePage, lv_obj_t* Pri_Page);
lv_obj_t* Return_Btn_Create(lv_obj_t* Current_BasePage,Return_Btn_Args_t* Args);//callback函数用于处理内存问题
lv_obj_t * TextArea_Create(lv_obj_t* Prev_Page,uint32_t Max_Lebgth,const char * placeholder_tex,bool password_mode, char * User_Data);
void Desktop(void);

void PWD_MATR(lv_obj_t* PRI_Page);

void PSWD_Meun_Page(lv_obj_t* PRI_Page);
//void PWDMeun_Add_New_PWD(lv_obj_t* PRI_Page);
//lv_obj_t* Add_New_PWD_Msg_Create (uint8_t *PWD_LEVL );
lv_obj_t* Add_New_PWD_Msg_Create (const char * title,const char * text , msg_Args_t * args);
#ifdef __cplusplus
}
#endif // __cplusplus

#endif

